var MushroomSprite=cc.Sprite.extend({
	radius:40,
	//==
	//构造函数
	//==
	
	ctor:function(){
		this._super();
		this.initWithFile(s_mushroom);
		cc.Director.getInstance().getTouchDispatcher().addTargetedDelegate(this,0,true);
	},

	//判断触摸点是否在图片上
	containsTouchLocation:function(touch){
		//获取触摸点位置
		var getPoint=touch.getLocation();
		//获取图片区域尺寸
		var contentSize=this.getContentSize();
		//定义拖曳区域
		var myRect=cc.rect(0,0,contentSize.width,contentSize.height);
		myRect.origin.x+=this.getPosition().x-this.getContentSize().width/2;
		myRect.origin.x+=this.getPosition().y-this.getContentSize().height/2;
		//判断触摸点是否在区域上
		return cc.Rect.CCRectContainsPoint(myRect,getPoint);
	},
	//刚触摸瞬间
	onTouchBegan:function(touch,event){
		if(!this.containsTouchLocation(touch))
			return false;
		return true;
	},
	//触摸移动
	onTouchMoved:function(touch,event){
		cc.log('onTouchMoved');
		var touchPoint=touch.getLocation();
		this.setPositionX(touchPoint.x);
	},
	
});
